import time
from flask import Blueprint, g, render_template
from models import DB, article, tag


home = Blueprint("home",__name__)



def index():
    # DB.drop_all()
    # article.Article()

    return render_template("index.html")


@home.route("/add")
def add():
    
    return article.add("t1", "an", 11, "[][][][]", "asdfg")

@home.route("/update")
def update():
    return tag.update(2, "juthrgfd")

@home.route("/all")
def all():
    g.tag = tag.get_all()
    return str(tag.count())


@home.route("/del")
def delete():
    a = article.delete(3)
    return a

@home.route("/articles")
def articles():
    a = tag.articles(4)
    return f"{a}"